#include"threadPool_v3.hpp"
#include"Task.hpp"

#include<time.h>
#include<pthread.h>
#include<memory>
#include<sys/types.h>
#include<unistd.h>
using namespace std;
const char* ops="+-*/%";
// void callBack(int reslut,int code)
// {
//     cout<<"reslut="<<reslut<<"exitcode="<<code<<endl;
// }




int main()
{
    unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>());
    tp->init();
    tp->start();

    while (true)
    {
        int x,y;
        char op;
        //生产
        cout<<"please enter X>";
        cin>>x;
        cout<<"please enter Y>";
        cin>>y;
        cout<<"please enter op(+-*/%)>";
        cin>>op;
        Task t(x,y,op);
        tp->pushTask(t);
        sleep(1);
        
    }
    
    return 0;
}